package com.dimples.wxpush.enums;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.map.MapUtil;
import com.dimples.wxpush.utils.LunarCalendar;
import lombok.Getter;

import java.util.List;
import java.util.Map;

/**
 * @author zhongyj <1126834403@qq.com><br/>
 * @date 2024/11/17
 */
@Getter
public enum BirthdateEnum {
    laoer("05-19", "老  二"),
    laodi("12-29", "老  弟"),
    ba_zg("04-05", "爸(女)"),
    ma_zg("08-03", "妈(女)"),
    ba_gy("07-29", "爸(男)"),
    ma_gy("11-17", "妈(男)"),
    waiye("07-27", "外  爷"),
    jiejie("09-26", "姐  姐"),
    gege("03-16", "哥  哥"),
    lulu("2-29", "露  露"),
    feifei("03-16", "菲  菲"),

    ;


    private final String birthday;

    private final String name;

    BirthdateEnum(String birthday, String name) {
        this.birthday = birthday;
        this.name = name;
    }

    public static Map<String, Integer> getBirthdayMap() {
        Map<String, Integer> map = MapUtil.newHashMap();
        List<String> nameList = CollUtil.newArrayList();
        List<Integer> dayList = CollUtil.newArrayList();
        for (BirthdateEnum birthdateEnum : BirthdateEnum.values()) {
            nameList.add(birthdateEnum.getName());
            dayList.add(LunarCalendar.getLunarBirthdayDay(birthdateEnum.getBirthday()));
        }
        for (int i = 0; i < nameList.size(); i++) {
            map.put(nameList.get(i), dayList.get(i));
        }
        return MapUtil.sortByValue(map, false);
    }
}





























